Skip to content

On branch edburns/spotless-agentic-workflow-42#43

Merged
edburns merged 2 commits intogithub:mainfrom
edburns:edburns/spotless-agentic-workflow-42
Mar 31, 2026
Merged

On branch edburns/spotless-agentic-workflow-42#43
edburns merged 2 commits intogithub:mainfrom
edburns:edburns/spotless-agentic-workflow-42

Conversation

@edburns
Copy link
Copy Markdown
Collaborator

@edburns edburns commented Mar 31, 2026

modified: .github/copilot-instructions.md

  • Added a new "Pre-commit Hooks and Formatting (Coding Agent)" section that:
  • Explains the hook is automatically enabled via copilot-setup-steps.yml
  • Gives explicit 3-step recovery instructions: mvn spotless:apply → git add -u → retry commit
  • Recommends running mvn spotless:apply proactively before committing

Now when the Copilot coding agent starts a session, the setup steps will enable the pre-commit hook, and if a commit is rejected by Spotless formatting checks, the agent has clear instructions to fix and retry.

modified: .github/workflows/copilot-setup-steps.yml

  • Added a new step "Enable pre-commit hooks" that runs git config core.hooksPath .githooks before the verification step
  • Updated the verification step to also print the configured hooks path for confirmation

Resolves #42

modified:   .github/copilot-instructions.md

 - Added a new "Pre-commit Hooks and Formatting (Coding Agent)" section
that:
  - Explains the hook is automatically enabled via copilot-setup-steps.yml
  - Gives explicit 3-step recovery instructions: mvn spotless:apply → git
add -u → retry commit
  - Recommends running mvn spotless:apply proactively before committing

Now when the Copilot coding agent starts a session, the setup steps will
enable the pre-commit hook, and if a commit is rejected by Spotless
formatting checks, the agent has clear instructions to fix and retry.

modified:   .github/workflows/copilot-setup-steps.yml

 - Added a new step "Enable pre-commit hooks" that runs git config
core.hooksPath .githooks before the verification step
 - Updated the verification step to also print the configured hooks path for
 confirmation

Signed-off-by: Ed Burns <edburns@microsoft.com>
Copilot AI review requested due to automatic review settings March 31, 2026 17:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Copilot coding-agent setup to proactively enable the repository’s pre-commit hook and documents a clear recovery flow when Spotless formatting checks block a commit, reducing agentic workflow failures caused by formatting.

Changes:

  • Enable Git hooks in the Copilot setup workflow by setting core.hooksPath to .githooks.
  • Extend the setup workflow verification output to print the configured hooks path.
  • Add Copilot agent guidance for handling Spotless pre-commit failures (apply → re-stage → retry).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/copilot-setup-steps.yml Configures the agent environment to enable pre-commit hooks and confirms hook path during verification.
.github/copilot-instructions.md Documents how the coding agent should recover from Spotless pre-commit failures and recommends running Spotless proactively.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@edburns edburns merged commit 6ccc5e3 into github:main Mar 31, 2026
@edburns edburns deleted the edburns/spotless-agentic-workflow-42 branch March 31, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Agentic workflow does not proactively deal with spotless failures

2 participants